<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SimpleWindow: Utils.h 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">SimpleWindow
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('_utils_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">Utils.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#pragma once</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="preprocessor">#include &lt;map&gt;</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="preprocessor">#include &lt;sstream&gt;</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="keyword">namespace </span>sw</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span>{</div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="};">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html">   13</a></span>    <span class="keyword">class </span><a class="code hl_class" href="classsw_1_1_utils.html">Utils</a></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span>    {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span>        <a class="code hl_class" href="classsw_1_1_utils.html">Utils</a>() = <span class="keyword">delete</span>; <span class="comment">// 删除构造函数</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span> </div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#ae08072c3e4e8796d5ffad7027e41f773">   25</a></span>        <span class="keyword">static</span> std::wstring <a class="code hl_function" href="classsw_1_1_utils.html#ae08072c3e4e8796d5ffad7027e41f773">ToWideStr</a>(<span class="keyword">const</span> std::string &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">str</a>, <span class="keywordtype">bool</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">utf8</a> = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span> </div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#a6cc154f2d595b5624b3aaca8b64fd3dd">   33</a></span>        <span class="keyword">static</span> std::string <a class="code hl_function" href="classsw_1_1_utils.html#a6cc154f2d595b5624b3aaca8b64fd3dd">ToMultiByteStr</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">wstr</a>, <span class="keywordtype">bool</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">utf8</a> = <span class="keyword">false</span>);</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#ac1a4b590a8f330ca9af3ec557f3c0eac">   40</a></span>        <span class="keyword">static</span> std::wstring <a class="code hl_function" href="classsw_1_1_utils.html#ac1a4b590a8f330ca9af3ec557f3c0eac">Trim</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">str</a>);</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span> </div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#ad19ab16d87c5c8f6ee319b593bf21fc7">   47</a></span>        <span class="keyword">static</span> std::wstring <a class="code hl_function" href="classsw_1_1_utils.html#ad19ab16d87c5c8f6ee319b593bf21fc7">TrimStart</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">str</a>);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#ab2e47287405f057170c24ba15d9ebe48">   54</a></span>        <span class="keyword">static</span> std::wstring <a class="code hl_function" href="classsw_1_1_utils.html#ab2e47287405f057170c24ba15d9ebe48">TrimEnd</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">str</a>);</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span> </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#a8f0292de23814b539a4f5db889422a06">   62</a></span>        <span class="keyword">static</span> std::vector&lt;std::wstring&gt; <a class="code hl_function" href="classsw_1_1_utils.html#a8f0292de23814b539a4f5db889422a06">Split</a>(<span class="keyword">const</span> std::wstring &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">str</a>, <span class="keyword">const</span> std::wstring &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">delimiter</a>);</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno">   63</span> </div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno">   64</span>    <span class="keyword">public</span>:</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00069" data-start="{" data-end="}">
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#add73fdd8d714ed80d3741fffcef5fbec">   69</a></span>        <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">inline</span> T <a class="code hl_function" href="classsw_1_1_utils.html#add73fdd8d714ed80d3741fffcef5fbec">Max</a>(<span class="keyword">const</span> T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">a</a>, <span class="keyword">const</span> T &amp;b)</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno">   70</span>        {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span>            <span class="keywordflow">return</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">a</a> &gt; b ? <a class="code hl_class" href="classsw_1_1_dictionary.html">a</a> : b;</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span>        }</div>
</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="foldopen" id="foldopen00078" data-start="{" data-end="}">
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#a76b3fe0842e62bf943a314afed4d474a">   78</a></span>        <span class="keyword">static</span> <span class="keyword">constexpr</span> <span class="keyword">inline</span> T <a class="code hl_function" href="classsw_1_1_utils.html#a76b3fe0842e62bf943a314afed4d474a">Min</a>(<span class="keyword">const</span> T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">a</a>, <span class="keyword">const</span> T &amp;b)</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno">   79</span>        {</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno">   80</span>            <span class="keywordflow">return</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">a</a> &lt; b ? <a class="code hl_class" href="classsw_1_1_dictionary.html">a</a> : b;</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span>        }</div>
</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span> </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno">   86</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span>... <a class="code hl_class" href="classsw_1_1_dictionary.html">Args</a>&gt;</div>
<div class="foldopen" id="foldopen00087" data-start="{" data-end="}">
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="classsw_1_1_utils.html#abb9a32e7b7d1fb83832c9a39a84c3452">   87</a></span>        <span class="keyword">static</span> <span class="keyword">inline</span> std::wstring <a class="code hl_function" href="classsw_1_1_utils.html#abb9a32e7b7d1fb83832c9a39a84c3452">BuildStr</a>(<span class="keyword">const</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">Args</a> &amp;...<a class="code hl_class" href="classsw_1_1_dictionary.html">args</a>)</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span>        {</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span>            std::wstringstream <a class="code hl_class" href="classsw_1_1_dictionary.html">wss</a>;</div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno">   90</span>            <span class="keywordtype">int</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">_</a>[]{(Utils::_BuildStr(<a class="code hl_class" href="classsw_1_1_dictionary.html">wss</a>, <a class="code hl_class" href="classsw_1_1_dictionary.html">args</a>), 0)...};</div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno">   91</span>            <span class="keywordflow">return</span> <a class="code hl_class" href="classsw_1_1_dictionary.html">wss</a>.str();</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno">   92</span>        }</div>
</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno">   93</span> </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno">   94</span>    <span class="keyword">private</span>:</div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span>        <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> _BuildStr(std::wostream &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">wos</a>, <span class="keyword">const</span> T &amp;<a class="code hl_class" href="classsw_1_1_dictionary.html">arg</a>)</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span>        {</div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno">  101</span>            <a class="code hl_class" href="classsw_1_1_dictionary.html">wos</a> &lt;&lt; <a class="code hl_class" href="classsw_1_1_dictionary.html">arg</a>;</div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno">  102</span>        }</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno">  103</span> </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno">  107</span>        <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> _BuildStr(std::wostream &amp;wos, <span class="keywordtype">bool</span> b)</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span>        {</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span>            wos &lt;&lt; (b ? L<span class="stringliteral">&quot;true&quot;</span> : L<span class="stringliteral">&quot;false&quot;</span>);</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span>        }</div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span> </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno">  115</span>        <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> _BuildStr(std::wostream &amp;wos, <span class="keyword">const</span> <span class="keywordtype">char</span> *str)</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno">  116</span>        {</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno">  117</span>            wos &lt;&lt; <a class="code hl_function" href="classsw_1_1_utils.html#ae08072c3e4e8796d5ffad7027e41f773">Utils::ToWideStr</a>(str);</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span>        }</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span>        <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> _BuildStr(std::wostream &amp;wos, <span class="keyword">const</span> std::string &amp;str)</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span>        {</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span>            wos &lt;&lt; <a class="code hl_function" href="classsw_1_1_utils.html#ae08072c3e4e8796d5ffad7027e41f773">Utils::ToWideStr</a>(str);</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span>        }</div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span> </div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno">  131</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno">  132</span>        <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> _BuildStr(std::wostream &amp;wos, <span class="keyword">const</span> std::vector&lt;T&gt; &amp;vec)</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span>        {</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span>            <span class="keyword">auto</span> beg = vec.begin();</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno">  135</span>            <span class="keyword">auto</span> end = vec.end();</div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span>            wos &lt;&lt; L<span class="stringliteral">&quot;[&quot;</span>;</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span> it = beg; it != end; ++it) {</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno">  138</span>                <span class="keywordflow">if</span> (it != beg)</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno">  139</span>                    wos &lt;&lt; L<span class="stringliteral">&quot;, &quot;</span>;</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno">  140</span>                Utils::_BuildStr(wos, *it);</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno">  141</span>            }</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno">  142</span>            wos &lt;&lt; L<span class="stringliteral">&quot;]&quot;</span>;</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno">  143</span>        }</div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno">  144</span> </div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span>        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> TKey, <span class="keyword">typename</span> TVal&gt;</div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span>        <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> _BuildStr(std::wostream &amp;wos, <span class="keyword">const</span> std::map&lt;TKey, TVal&gt; &amp;map)</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span>        {</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span>            <span class="keyword">auto</span> beg = map.begin();</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno">  152</span>            <span class="keyword">auto</span> end = map.end();</div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span>            wos &lt;&lt; L<span class="stringliteral">&quot;{&quot;</span>;</div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span>            <span class="keywordflow">for</span> (<span class="keyword">auto</span> it = beg; it != end; ++it) {</div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span>                <span class="keywordflow">if</span> (it != beg)</div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span>                    wos &lt;&lt; L<span class="stringliteral">&quot;, &quot;</span>;</div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno">  157</span>                Utils::_BuildStr(wos, it-&gt;first);</div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno">  158</span>                wos &lt;&lt; L<span class="stringliteral">&quot;:&quot;</span>;</div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno">  159</span>                Utils::_BuildStr(wos, it-&gt;second);</div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno">  160</span>            }</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno">  161</span>            wos &lt;&lt; L<span class="stringliteral">&quot;}&quot;</span>;</div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno">  162</span>        }</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno">  163</span>    };</div>
</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno">  164</span>}</div>
<div class="ttc" id="aclasssw_1_1_dictionary_html"><div class="ttname"><a href="classsw_1_1_dictionary.html">sw::Dictionary</a></div><div class="ttdoc">字典类，内部维护了一个指向std::map的智能指针</div><div class="ttdef"><b>Definition</b> Dictionary.h:24</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html"><div class="ttname"><a href="classsw_1_1_utils.html">sw::Utils</a></div><div class="ttdoc">工具类</div><div class="ttdef"><b>Definition</b> Utils.h:14</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_a6cc154f2d595b5624b3aaca8b64fd3dd"><div class="ttname"><a href="classsw_1_1_utils.html#a6cc154f2d595b5624b3aaca8b64fd3dd">sw::Utils::ToMultiByteStr</a></div><div class="ttdeci">static std::string ToMultiByteStr(const std::wstring &amp;wstr, bool utf8=false)</div><div class="ttdoc">将宽字符串转为窄字符串</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_a76b3fe0842e62bf943a314afed4d474a"><div class="ttname"><a href="classsw_1_1_utils.html#a76b3fe0842e62bf943a314afed4d474a">sw::Utils::Min</a></div><div class="ttdeci">static constexpr T Min(const T &amp;a, const T &amp;b)</div><div class="ttdoc">取两值中的较小值</div><div class="ttdef"><b>Definition</b> Utils.h:78</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_a8f0292de23814b539a4f5db889422a06"><div class="ttname"><a href="classsw_1_1_utils.html#a8f0292de23814b539a4f5db889422a06">sw::Utils::Split</a></div><div class="ttdeci">static std::vector&lt; std::wstring &gt; Split(const std::wstring &amp;str, const std::wstring &amp;delimiter)</div><div class="ttdoc">对字符串按照指定分隔符进行拆分</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_ab2e47287405f057170c24ba15d9ebe48"><div class="ttname"><a href="classsw_1_1_utils.html#ab2e47287405f057170c24ba15d9ebe48">sw::Utils::TrimEnd</a></div><div class="ttdeci">static std::wstring TrimEnd(const std::wstring &amp;str)</div><div class="ttdoc">删除串尾空白字符</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_abb9a32e7b7d1fb83832c9a39a84c3452"><div class="ttname"><a href="classsw_1_1_utils.html#abb9a32e7b7d1fb83832c9a39a84c3452">sw::Utils::BuildStr</a></div><div class="ttdeci">static std::wstring BuildStr(const Args &amp;...args)</div><div class="ttdoc">拼接字符串，也可使用此函数将其他类型转为wstring</div><div class="ttdef"><b>Definition</b> Utils.h:87</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_ac1a4b590a8f330ca9af3ec557f3c0eac"><div class="ttname"><a href="classsw_1_1_utils.html#ac1a4b590a8f330ca9af3ec557f3c0eac">sw::Utils::Trim</a></div><div class="ttdeci">static std::wstring Trim(const std::wstring &amp;str)</div><div class="ttdoc">删除首尾空白字符</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_ad19ab16d87c5c8f6ee319b593bf21fc7"><div class="ttname"><a href="classsw_1_1_utils.html#ad19ab16d87c5c8f6ee319b593bf21fc7">sw::Utils::TrimStart</a></div><div class="ttdeci">static std::wstring TrimStart(const std::wstring &amp;str)</div><div class="ttdoc">删除串首空白字符</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_add73fdd8d714ed80d3741fffcef5fbec"><div class="ttname"><a href="classsw_1_1_utils.html#add73fdd8d714ed80d3741fffcef5fbec">sw::Utils::Max</a></div><div class="ttdeci">static constexpr T Max(const T &amp;a, const T &amp;b)</div><div class="ttdoc">取两值中的较大值</div><div class="ttdef"><b>Definition</b> Utils.h:69</div></div>
<div class="ttc" id="aclasssw_1_1_utils_html_ae08072c3e4e8796d5ffad7027e41f773"><div class="ttname"><a href="classsw_1_1_utils.html#ae08072c3e4e8796d5ffad7027e41f773">sw::Utils::ToWideStr</a></div><div class="ttdeci">static std::wstring ToWideStr(const std::string &amp;str, bool utf8=false)</div><div class="ttdoc">将窄字符串转为宽字符串</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_01fcd3835fb4e7d9331b722d86291b65.html">sw</a></li><li class="navelem"><a class="el" href="dir_ed5f6ece24ffcc4307a76d27c2494db3.html">inc</a></li><li class="navelem"><b>Utils.h</b></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
  </ul>
</div>
</body>
</html>
